<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>name写锚点</title>
    <style>
        a{
            width:100%;
            height:500px;
            background-color: yellow;
        }
        #main,#main2{
            width:100%;
            height:400px;
            background-color: pink;
        }
        #bottom{
            width:100%;
            height:400px;
            background-color: black;
        }
    </style>
</head>
<body>
<!--但是用name来做的锚点只能用于a标签-->
<a name="top"></a>
<div id="main"></div>
<div id="bottom"></div>
<div id="main2"></div>
<a href="#top">点击跳到第一段</a>
</body>
</html>